<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            background-color: black;
            margin: 0;
        }
        
        .box {
            width: 300px;
            height: 120px;
            animation: move 10s linear infinite;
        }
        
        .fish {
            width: 300px;
            height: 120px;
            background-image: url(./img/fish.png);
            animation: cut 1s steps(8) infinite;
            /*  */
            margin-top: 100px;
            /* 基点变成左下角了 */
            transform-origin: left bottom;
        }
        /* 鱼扭动 */
        
        @keyframes cut {
            0% {
                background-position: left 0;
            }
            100% {
                background-position: left -960px;
            }
        }
        /* 鱼整体移动 */
        
        @keyframes move {
            0% {
                transform: translateX(0);
            }
            100% {
                transform: translateX(900px);
            }
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="fish">

        </div>
    </div>
</body>

</html>